<template>
  <view>
    <view class="conetent">
      <view class="toy_box">
        <text class="yz-iconfont yz-2"></text>
        <view class="detail">{{common.auditConfig.settled_notice1}}</view>
      </view>
      <view class="cont">
        <text>注：</text>带“<text>*</text>”的为入驻必填项。不带“<text>*</text>”的为入驻选填项，不带“<text>*</text>”选填项可在注册入驻后自己进行再次丰富内容!
      </view>
      <view class="cont" style="text-indent: 44rpx">
        {{common.auditConfig.settled_notice2}}
      </view>
    </view>

    <view class="card" v-if="common.auditConfig.audit_on==0">
      <view class="title"><text>*</text>1.授课方式（可多选）</view>
      <uni-data-checkbox multiple :value="teaching_method" v-model="teaching_method" :localdata="teaching_method_list"></uni-data-checkbox>
    </view>

    <view class="card" v-if="common.auditConfig.audit_on==0">
      <view class="title"><text>*</text>2.请选择入驻类型（可多选）</view>

      <view class="gray_round">
        <view class="enter">免费入驻</view>
        <uni-data-checkbox @change="settledTypeFreeChange" multiple :value="settled_type_free" v-model="settled_type_free" :localdata="settled_type_free_list"></uni-data-checkbox>
      </view>

      <view class="gray_round">
        <view class="enter">付费入驻<text>(单项需要付{{common.customConfig.settled_price}}元入驻费用，未接单可申请全额退费。且必 须要填写教师资格证)</text></view>
        <uni-data-checkbox @change="settledTypeChange" multiple :value="settled_type" v-model="settled_type" :localdata="settled_type_list"></uni-data-checkbox>
      </view>
    </view>

    <view class="card" v-if="show_main_image && common.auditConfig.audit_on==0 && cert_require">
      <view class="title">教师资格证</view>
      <view class="ts-24" :style="cert_require?'color:red;':''">（专职教学家教、学校找代课教员、机构找代课教员必填项）</view>
      <view class="big_upload_picker">
        <image class="image" :src="$xyfun.image(main_image)" v-if="main_image!==''"></image>
        <view class="big_upload" v-else>+</view>
        <upload-image @chooseFile="chooseMainImage" class="hover"></upload-image>
      </view>
    </view>

    <view class="card">
      <view class="title"><text>*</text><span v-if="common.auditConfig.audit_on==0">3.</span>请填写相关信息</view>
      <view class="item" v-if="common.auditConfig.audit_on==1">
        <view class="tit">培训班名称<text>*</text></view>
        <view class="input">
          <input type="text" placeholder="请输入培训班名称"/>
        </view>
      </view>
      <view class="item" v-if="common.auditConfig.audit_on==0">
        <view class="tit">教员昵称<text>*</text></view>
        <view class="input">
          <input type="text" v-model="nickname" placeholder="请输入在平台显示的昵称"/>
        </view>
      </view>
      <view class="item">
        <view class="tit">联系方式<text>*</text></view>
        <view class="input">
          <input type="text" v-model="mobile" placeholder="请输入你的联系方式"/>
        </view>
      </view>
      <view class="item" v-if="before_status!==2">
        <view class="tit">微信手机号码<text>*</text></view>
        <view class="input">
          <input type="text" v-model="wx_phone" placeholder="请输入微信手机号码"/>
        </view>
      </view>
      <view class="item" v-if="before_status!==2">
        <view class="tit">真实姓名<text>*</text></view>
        <view class="input">
          <input type="text" v-model="realname" placeholder="请输入真实姓名"/>
        </view>
      </view>
      <view class="item" v-if="before_status!==2">
        <view class="tit">身份证号码(非必填项)</view>
        <view class="input">
          <input type="text" v-model="id_code" placeholder="请输入你身份证号码"/>
        </view>
      </view>
      <view class="item" v-if="before_status!==2">
        <view class="tit">性别<text>*</text></view>
        <view class="input">
          <picker type="text" @change="sexChange" :value="sex" :range="sex_list">{{sex!==''?sex:'请选择性别'}}</picker>
        </view>
      </view>
    </view>

    <view class="card" v-if="before_status!==2">
      <view class="title"><span v-if="common.auditConfig.audit_on==0">4.</span>请上传身份证(非必填项)</view>
      <view class="id_card">
        <image class="bg" :src="$xyfun.image(id_card_front)" v-if="id_card_front!==''"></image>
        <image class="bg" :src="$xyfun.image('/static/course/idCardFront.png')" v-else></image>
        <upload-image @chooseFile="chooseIdCardFront" class="hover"></upload-image>
      </view>
      <view class="id_card">
        <image class="bg" :src="$xyfun.image(id_card_reverse)" v-if="id_card_reverse!==''"></image>
        <image class="bg" :src="$xyfun.image('/static/course/idCardReverse.png')" v-else></image>
        <upload-image @chooseFile="chooseIdCardReverse" class="hover"></upload-image>
      </view>
      <view class="id_card_notice">
        <view class="tit">拍摄须知：</view>
        <view class="desc">请正确上传身份证，上传身份证须全面完整，不可存在边框缺失、照片模糊、闪光强烈等照片，否则将上传失败。</view>
      </view>
      <image class="wa m-t-20" :src="$xyfun.image('/static/course/cert_upload_notice.png')" mode="widthFix"></image>
    </view>

    <view class="card" v-if="before_status!==2">
      <view class="title"><text>*</text><span v-if="common.auditConfig.audit_on==0">5.</span>请上传学生证 / 校园卡 / 毕业证书</view>
      <view class="ts-24">请上传毕业证书、学生证、校园卡其一，须看清证书编号（若全填，将提高评级）</view>
      <view class="certs">
        <view class="cert">
          <image class="bg" :src="$xyfun.image('/static/course/cert_cases1.png')"></image>
        </view>
        <view class="cert">
          <image class="bg" :src="$xyfun.image('/static/course/cert_cases2.png')"></image>
        </view>
        <view class="cert">
          <image class="bg" :src="$xyfun.image(school_image)" v-if="school_image!==''"></image>
          <view class="cert_upload" v-else>+</view>
          <upload-image @chooseFile="chooseSchoolImage" class="hover"></upload-image>
        </view>
      </view>
      <view class="ts-24">手持该证同框清晰照</view>
      <view class="certs">
        <view class="cert">
          <image class="bg" :src="$xyfun.image('/static/course/cert_cases1.png')"></image>
        </view>
        <view class="cert">
          <image class="bg" :src="$xyfun.image('/static/course/cert_cases2.png')"></image>
        </view>
        <view class="cert">
          <image class="bg" :src="$xyfun.image(school_image_hand)" v-if="school_image_hand!==''"></image>
          <view class="cert_upload" v-else>+</view>
          <upload-image @chooseFile="chooseSchoolImageHand" class="hover"></upload-image>
        </view>

      </view>
    </view>

    <view class="card" v-if="before_status!==2">
      <view class="title" style="text-align: center"><text>*</text><span v-if="common.auditConfig.audit_on==0">6.</span>所属院校</view>
      <view class="item">
        <view class="tit">院校名称<text>*</text></view>
        <view class="input" @tap="$xyfun.to('/pages/teacher/school')">
          <view class="simulate">{{school_id?school_name:'请输入院校名称，20字以内'}}</view>
        </view>
      </view>
      <view class="item">
        <view class="tit">开始时间<text>*</text></view>
        <view class="input">
          <picker mode="date" @change="learnStartChange">
            <view class="picker">
              {{ learn_start!==''?learn_start:'请选择时间' }}
            </view>
          </picker>
        </view>
      </view>
      <view class="item">
        <view class="tit">结束时间<text>*</text></view>
        <view class="input">
          <picker mode="date" @change="learnEndChange">
            <view class="picker">
              {{ learn_end!==''?learn_end:'请选择时间' }}
            </view>
          </picker>
        </view>
      </view>
      <view class="item">
        <view class="tit">学历<text>*</text></view>
        <view class="input">
          <picker type="text" @change="educationChange" :range="education_list">{{education!==''?education:'请选择学历'}}</picker>
        </view>
      </view>
      <view class="item">
        <view class="tit">专业<text>*</text></view>
        <view class="input">
          <input type="text" v-model="profession" placeholder="请输入专业，20字以内"/>
        </view>
      </view>
      <view class="item">
        <view class="tit">年级<text>*</text></view>
        <view class="input">
          <picker type="text" @change="teacherGradeChange" :range="teacher_grade_list">{{grade!==''?grade:'请选择年级'}}</picker>
        </view>
      </view>
    </view>

    <view class="card" v-if="common.auditConfig.audit_on==0">
      <view class="title" style="text-align: center"><text>*</text>7.授课科目</view>
      <view class="item">
        <view class="tit">主教</view>
        <view class="input picker_group">
          <view class="pg_item">
            <picker type="text" @change="gradeGroupChange" data-key="0" :range="grade_list" range-key="name">{{give_lessons[0].grade!==''?give_lessons[0].grade_cn:'选年级'}}
              <text class="yz-iconfont yz-jiantou2"></text>
            </picker>
          </view>
          <view class="pg_item">
            <picker type="text" @change="subjectGroupChange" data-key="0" :range="gl_subject_list1" range-key="name">{{give_lessons[0].subject!==''?give_lessons[0].subject_cn:'选科目'}}
              <text class="yz-iconfont yz-jiantou2"></text>
            </picker>
          </view>
          <view class="pg_item">
            <span>{{ give_lessons_notice[0] }}</span>
          </view>
        </view>
      </view>

      <view class="item">
        <view class="tit">辅教</view>
        <view class="input picker_group">
          <view class="pg_item">
            <picker type="text" @change="gradeGroupChange" data-key="1" :range="grade_list" range-key="name">{{give_lessons[1].grade!==''?give_lessons[1].grade_cn:'选年级'}}
              <text class="yz-iconfont yz-jiantou2"></text>
            </picker>
          </view>
          <view class="pg_item">
            <picker type="text" @change="subjectGroupChange" data-key="1" :range="gl_subject_list2" range-key="name">{{give_lessons[1].subject!==''?give_lessons[1].subject_cn:'选科目'}}
              <text class="yz-iconfont yz-jiantou2"></text>
            </picker>
          </view>
          <view class="pg_item">
            <span>{{ give_lessons_notice[1] }}</span>
          </view>
        </view>
      </view>

      <view class="item">
        <view class="tit">辅教</view>
        <view class="input picker_group">
          <view class="pg_item">
            <picker type="text" @change="gradeGroupChange" data-key="2" :range="grade_list" range-key="name">{{give_lessons[2].grade!==''?give_lessons[2].grade_cn:'选年级'}}
              <text class="yz-iconfont yz-jiantou2"></text>
            </picker>
          </view>
          <view class="pg_item">
            <picker type="text" @change="subjectGroupChange" data-key="2" :range="gl_subject_list3" range-key="name">{{give_lessons[2].subject!==''?give_lessons[2].subject_cn:'选科目'}}
              <text class="yz-iconfont yz-jiantou2"></text>
            </picker>
          </view>
          <view class="pg_item">
            <span>{{ give_lessons_notice[2] }}</span>
          </view>
        </view>
      </view>
      <view class="notice"><text class="yz-iconfont yz-gouxuan"></text><text>可免审核自主修改</text></view>
    </view>

    <view class="card" v-if="common.auditConfig.audit_on==0">
      <view class="title" style="text-align: center"><text>*</text>8.授课时间</view>
      <view class="give_timesec">
        <uni-data-checkbox v-model="give_timesec" :localdata="give_timesec_list"></uni-data-checkbox>
      </view>
      <view class="give_time">
        <view class="thead">
          <view class="thead_first" :style="'background-image:url('+$xyfun.image('/static/other/diagonal-line.png')+')'">
            <view>时间</view>
            <view>周次</view>
          </view>
          <view>上午</view>
          <view>下午</view>
          <view>晚上</view>
        </view>
        <view class="tbody">
          <view class="th" v-for="(val,idx) in week_list">
            <view class="tbody_first">
              {{ val }}
            </view>
            <view @longpress="clearGiveTime" :data-key="idx" :data-timesec="'morning'"><picker mode="multiSelector" :range="morning" @change="giveTimeInput" :data-key="idx" :data-timesec="'morning'"><text>{{give_time[idx].morning}}</text></picker></view>
            <view @longpress="clearGiveTime" :data-key="idx" :data-timesec="'afternoon'"><picker mode="multiSelector" :range="afternoon" @change="giveTimeInput" :data-key="idx" :data-timesec="'afternoon'"><text>{{give_time[idx].afternoon}}</text></picker></view>
            <view @longpress="clearGiveTime" :data-key="idx" :data-timesec="'night'"><picker mode="multiSelector" :range="night" @change="giveTimeInput" :data-key="idx" :data-timesec="'night'"><text>{{give_time[idx].night}}</text></picker></view>
          </view>
        </view>
      </view>
      <view class="notice"><text class="yz-iconfont yz-gouxuan"></text><text>可填写授课时间段,长按清除某个时间段</text></view>
      <view class="notice"><text class="yz-iconfont yz-gouxuan"></text><text>可免审核自主修改</text></view>
    </view>

    <view class="card" v-if="common.auditConfig.audit_on==0">
      <view class="title tc"><text>*</text>9.非寒暑假可授课区域</view>
      <view class="item addr_item">
        <view class="tit">定位</view>
        <view class="input">
          <xy-picker-address class="simulate" @change="chooseUnHolidayChange">
            {{unholiday_pick!==''?unholiday_pick:'请选择省份'}}
          </xy-picker-address>
        </view>
      </view>
      <view style="margin: 20rpx 10rpx;" v-if="unholiday_pick_arr.length>0">
        <uni-data-checkbox multiple :value="unholiday_pick_arr_selected" v-model="unholiday_pick_arr_selected" :localdata="unholiday_pick_arr"></uni-data-checkbox>
      </view>
      <view class="notice"><text class="yz-iconfont yz-gouxuan"></text><text>可免审核自主修改</text></view>
      <view class="item addr_item">
        <view class="tit"></view>
        <view class="input" @tap="mapUnHoliday">
          <view class="simulate" style="height: auto;padding: 10rpx 0;" v-if="unholiday_area[0]===''">请选择地址</view>
          <view class="simulate" style="height: auto;padding: 10rpx 0;" v-else>{{unholiday_area[0]}}{{unholiday_area[1]}}</view>
        </view>
      </view>
    </view>

    <view class="card" v-if="common.auditConfig.audit_on==0">
      <view class="title tc"><text>*</text>10.寒暑假授课区域</view>
      <view class="item addr_item">
        <view class="tit">定位</view>
        <view class="input">
          <xy-picker-address class="simulate" @change="chooseHolidayChange">
            {{holiday_pick!==''?holiday_pick:'请选择省份'}}
          </xy-picker-address>
        </view>
      </view>
      <view style="margin: 20rpx 10rpx;" v-if="holiday_pick_arr.length>0">
          <uni-data-checkbox multiple :value="holiday_pick_arr_selected" v-model="holiday_pick_arr_selected" :localdata="holiday_pick_arr"></uni-data-checkbox>
      </view>
      <view class="notice"><text class="yz-iconfont yz-gouxuan"></text><text>可免审核自主修改</text></view>
      <view class="item addr_item">
        <view class="tit"></view>
        <view class="input" @tap="mapHoliday">
          <view class="simulate" style="height: auto;padding: 10rpx 0;" v-if="holiday_area[0]===''">请选择地址</view>
          <view class="simulate" style="height: auto;padding: 10rpx 0;" v-else>{{holiday_area[0]}}{{holiday_area[1]}}</view>
        </view>
      </view>
    </view>


    <view class="card">
      <view class="title tc"><text>*</text><span v-if="common.auditConfig.audit_on==0">11.</span>个人照片</view>
      <view class="tc tc-g ts-24 m-t-30">每次只能选择1张上传，至少上传1张，建议比例宽：高16：9</view>
      <uploads ref="uploads" :img-list="photo_images" @chooseFile="PhotoImagesChoose"></uploads>
    </view>

    <view class="card">
      <view class="item" style="height: unset;padding-bottom: 20rpx;padding-top: 20rpx;">
        <view class="tit"><span v-if="common.auditConfig.audit_on==0">12.</span>头像</view>
        <view class="avatar" :style="'background-image: url('+$xyfun.image('/static/other/avatar.png')+')'">
          <image class="image" :src="$xyfun.image(avatar)" v-if="avatar!==''"></image>
          <upload-image @chooseFile="AvatarChoose" class="hover"></upload-image>
        </view>
      </view>
      <view class="item" v-if="common.auditConfig.audit_on==0">
        <view class="tit">13.教龄</view>
        <view class="input">
          <input type="number" maxlength="2" v-model="teacher_age" placeholder="请输入数字，如：1、2、3"/>
        </view>
      </view>
    </view>

    <view class="card">
      <view class="title" style="text-align: center"><span v-if="common.auditConfig.audit_on==0">14.</span>个人标签（3个以下）</view>
      <view class="item" v-for="(val,idx) in tags">
        <view class="tit" :style="idx===0?'':'opacity:0'">自定义</view>
        <view class="tag">
          <view class="input">
            <input type="text" maxlength="4" @input="tagsInput" :data-key="idx" :value="tags[idx]" placeholder="请输入标签，最多4个字">
          </view>
          <view class="action" v-if="idx===tags.length-1 && tags.length<3" @tap="tagsAdd"><view>+</view>添加</view>
          <view class="action" v-else @tap="tagsRemove" :data-key="idx"><view>-</view>删除</view>
        </view>
      </view>
    </view>


    <view class="card" v-if="show_main_image && common.auditConfig.audit_on==0">
      <view class="title">15.教师资格证</view>
      <view class="ts-24">（专职教学家教、学校找代课教员、机构找代课教员必填项）</view>
      <view class="big_upload_picker">
        <image class="image" :src="$xyfun.image(main_image)" v-if="main_image!==''"></image>
        <view class="big_upload" v-else>+</view>
        <upload-image @chooseFile="chooseMainImage" class="hover"></upload-image>
      </view>
    </view>

    <view class="card" v-if="before_status!==2 && common.auditConfig.audit_on==0">
      <view class="title">16.职称</view>
      <view class="item">
        <view class="tit">教师职称</view>
        <view class="input">
          <input type="text" v-model="cert_name" placeholder="请输入职称"/>
        </view>
      </view>
      <view class="small_upload_picker">
        <image class="image" v-if="cert_image!==''" :src="$xyfun.image(cert_image)"></image>
        <view v-else>
          <view class="notice">教师职称证书</view>
          <view class="small_upload">+</view>
        </view>
        <upload-image @chooseFile="chooseCertImage" class="hover"></upload-image>
      </view>
    </view>

    <view class="card" v-if="common.auditConfig.audit_on==0">
      <view class="title tc">17.个人简历</view>
      <view class="exp_item" v-for="(val,idx) in teacher_exp">
        <view class="yz-iconfont yz-guanbi" @click="expDelRow(idx)" v-if="teacher_exp.length>1"></view>
        <view class="item">
          <view class="tit">开始时间</view>
          <view class="input">
            <picker mode="date" :data-key="idx" @change="expStartChange">{{ teacher_exp[idx].start!==''?teacher_exp[idx].start:'请选择时间' }}</picker>
          </view>
        </view>
        <view class="item">
          <view class="tit">结束时间</view>
          <view class="input">
            <picker mode="date" :data-key="idx" @change="expEndChange">{{ teacher_exp[idx].end!==''?teacher_exp[idx].end:'请选择时间' }}</picker>
          </view>
        </view>
        <textarea class="case_edit" maxlength="-1" :data-key="idx" v-model="teacher_exp[idx].content" placeholder="您曾任职的单位、岗位、具体教学对象和内容等（50字以上）">
        </textarea>
      </view>
      <view class="add_exp" @tap="expAddRow">添加经历</view>
    </view>

    <view class="card" v-if="common.auditConfig.audit_on==0">
      <view class="title">18.成功案例</view>
      <view class="item">
        <view class="tit">标题</view>
        <view class="input">
          <input type="text" maxlength="20" v-model="case_name" placeholder="请输入标题，20字以内"/>
        </view>
      </view>
      <textarea class="case_edit" maxlength="-1" v-model="case_content" placeholder="您曾取得的教学成效、科研成果等（50字以上）">
      </textarea>
    </view>

    <view class="card" v-if="before_status!==2  && common.auditConfig.audit_on==0">
      <view class="title" style="text-align: center">19.奖励荣誉</view>
      <view class="tc tc-g ts-24 m-t-30">请输入荣誉详情</view>
      <uploads ref="uploads" :img-list="honor_images" @chooseFile="HonorImagesChoose"></uploads>
    </view>

    <view class="card" v-if="common.auditConfig.audit_on==0">
      <view class="title flex ali-cen just-sb">20.个人视频/作品视频
        <view class="ts-24" style="font-weight: normal;">上传视频更容易获得家长的青睐哦</view>
      </view>
      <view class="ts-24 lh-32">1、最多只能上传1个视频，建议视频120秒以内</view>
      <view class="ts-24 lh-32">2、视频内容可以是老师的个人介绍/教学展示/作品展示</view>
      <view class="ts-24 lh-32">3、视频开头介绍统一话术:各位家长学生大家好</view>

      <view class="small_upload_picker">
        <video v-if="person_video_local" :src="person_video_local"></video>
        <view v-else>
          <view class="small_upload">+</view>
        </view>
        <upload-video @chooseFile="PersonVideo" class="hover"></upload-video>
      </view>
    </view>

    <view style="height: 100rpx;"></view>


    <view class="confirm_box">
      <view class="confirm" @tap="confirm()" v-if="before_status==0">提交审核</view>
      <view class="confirm" @tap="confirm()" v-if="before_status==1">修改资料</view>
      <view class="confirm" @tap="confirm()" v-if="before_status==2">修改资料</view>
      <view class="confirm" @tap="confirm()" v-if="before_status==3">重新提交资料</view>
      <view class="draft" @tap="savaDraft()" v-if="before_status==0">
        <view class="yz-iconfont yz-caogaoxiang"></view>
        <text>保存草稿</text>
      </view>
    </view>

    <payPop ref='payPop' title="请缴纳入驻费用" @createOrder="createOrder"></payPop>

    <view class="xy-modal-box xy-modal-box-center agreement-box" :class="[agreementModelShow?'xy-modal-show':'']">
      <view class="agree-title">我的合同</view>
      <view class="agree-content">
        <rich-text :nodes="agree_content"></rich-text>
      </view>

      <view class="agree-action">
        <view class="countdown" v-if="agree_countdown>0">请先至少认真阅读{{agree_countdown}}秒钟</view>
        <block v-else>
          <view class="yes" @tap="agree_yes">同意</view>
          <view class="no" @tap="agree_no">拒绝</view>
        </block>
      </view>
    </view>
    <view class="xy-modal-mask" :class="[agreementModelShow?'xy-mask-show':'']" @tap="agreementModelShow =!agreementModelShow"></view>
  </view>
</template>

<script>
import { mapState } from 'vuex';
import xyPickerAddress from '@/components/xy-picker/address';
import uniDataChecklist from "@/components/uni-data-checkbox/index.vue";
import uploads from "@/components/form-item/uploads.vue";
import uploadImage from "@/components/form-item/upload-image.vue";
import uploadVideo from "@/components/form-item/upload-video.vue";
import payPop from '@/components/paypop/index.vue';
import Pay from '@/utils/pay';

export default {
  components: {uniDataCheckbox:uniDataChecklist,uploads,uploadImage,uploadVideo,payPop,xyPickerAddress},
  data() {
    return {
      id : '',
      teaching_method: [],
      teaching_method_list: [],

      settled_type_free: [],
      settled_type_free_list: [],

      settled_type: [],
      settled_type_list: [],

      settled_money: 300,

      nickname : '',
      mobile : '',
      wx_phone : '',
      realname : '',
      id_code : '',
      sex : '',
      sex_list : ['男','女'],

      id_card_front : '',
      id_card_reverse : '',

      school_image : '',
      school_image_hand : '',

      school_id : '',
      school_name: '',
      learn_start: '',
      learn_end: '',

      education: '',
      education_list: [],

      profession: '',

      grade: '',
      teacher_grade_list : [],

      grade_list: [
      ],
      grade_origal: [],


      subject_list: [
      ],

      gl_subject_list1 : [],
      gl_subject_list2 : [],
      gl_subject_list3 : [],
      give_lessons: [
        {
          grade : '',
          grade_cn : '',
          subject : '',
          subject_cn : '',
        },
        {
          grade : '',
          grade_cn : '',
          subject : '',
          subject_cn : '',
        },{
          grade : '',
          grade_cn : '',
          subject : '',
          subject_cn : '',
        }
      ],
      give_lessons_notice: [
          '元/两小时',
          '元/两小时',
          '元/两小时',
      ],

      give_timesec: '',
      give_timesec_list: [

      ],

      week_list: [
        '周一',
        '周二',
        '周三',
        '周四',
        '周五',
        '周六',
        '周日'
      ],

      give_time: [
        {morning : '', afternoon : '', night : ''},
        {morning : '', afternoon : '', night : ''},
        {morning : '', afternoon : '', night : ''},
        {morning : '', afternoon : '', night : ''},
        {morning : '', afternoon : '', night : ''},
        {morning : '', afternoon : '', night : ''},
        {morning : '', afternoon : '', night : ''},
      ],

      morning: [
        ["06","07","08","09","10","11"],
        ["00","01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59"],
        ["至"],
        ["06","07","08","09","10","11","12"],
        ["00","01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59"]
      ],
      afternoon: [
        ["12","13","14","15","16","17"],
        ["00","01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59"],
        ["至"],
        ["12","13","14","15","16","17","18"],
        ["00","01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59"]
      ],
      night: [
        ["18","19","20","21","22","23"],
        ["00","01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59"],
        ["至"],
        ["18","19","20","21","22","23","24"],
        ["00","01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59"]
      ],

      holiday_pick: '',
      holiday_pick_arr: [],
      holiday_pick_arr_selected: [],
      holiday_area: ['','','',''],
      unholiday_pick: '',
      unholiday_pick_arr: [],
      unholiday_pick_arr_selected: [],
      unholiday_area: ['','','',''],

      photo_images: [],


      avatar: '',
      teacher_age: '',
      tags : [''],

      main_image: '',
      show_main_image: true,
      cert_require: false,

      cert_name: '',
      cert_image: '',

      teacher_exp: [
        {
          start : '',
          end : '',
          content : ''
        }
      ],

      case_name: '',
      case_content: '',

      honor_images: [],

      person_video: '',
      person_video_local : '',

      order: {},
      before_status : 0,

      agree_countdown: 3, // 初始倒计时秒数
      countdown: 10, // 初始倒计时秒数
      timer: null, // 定时器
      agree : false,
      agree_title : '',
      agree_content : '',
      agreementModelShow:false,
    };
  },
  computed: {
    ...mapState(['common'])
  },

  watch:{
    // holiday_pick_arr_selected(){
    //   console.log(this.holiday_pick_arr_selected)
    // }
  },

  async onLoad() {
    uni.setNavigationBarTitle({
      title : this.common.auditConfig.pages_teacher_apply
    })
    this.loadData();

    this.settled_type_free_list = this.arrFormat(this.common.customConfig.settled_type_free);
    this.settled_type_list = this.arrFormat(this.common.customConfig.settled_type);
    this.settled_money = this.common.customConfig.settled_price;

    this.teaching_method_list = this.arrFormat(this.common.customConfig.teaching_method);
    this.education_list = this.common.customConfig.education;
    this.teacher_grade_list = this.common.customConfig.group;

    this.subject_list = this.common.customConfig.subject;
    this.grade_list = this.common.customConfig.grade_normal;
    this.grade_origal = this.common.customConfig.grade_normal;

    this.give_timesec_list = this.arrFormat(this.common.customConfig.year_free);

  },
  methods:{

    async loadData() {
      this.$api.get({
        url: '/user/user_center',
        loadingTip: '加载中...',
        success: res => {
          if(res.agreement){
            this.agree = true;
          }else{
            this.agree = false;
          }
        }
      })
      this.$api.getBase({
        url: '/news/detail',
        loadingTip:'加载中...',
        data: {
          id:22,
        },
        success: res => {
          this.agree_title = res.title;
          this.agree_content = res.content;
        }
      });
      this.$api.getBase({
        url: 'teacher/before',
        loadingTip: '加载中...',
        success: res => {
          if(res){
            this.teaching_method = (res.teaching_method).split(',');//授课方式
            if(res.settled_type_free!==''){
              this.settled_type_free = (res.settled_type_free).split(',');//免费入驻类型
            }
            if(res.settled_type!==''){
              this.settled_type = (res.settled_type).split(',');//付费入驻类型
            }
            this.nickname = res.nickname;//昵称
            this.mobile = res.mobile;//联系方式
            this.wx_phone = res.wx_phone;//微信手机号
            this.realname = res.realname;//真实姓名
            this.id_code = res.id_code;//身份证号
            this.sex = res.sex;//男
            this.id_card_front = res.id_card_front;//身份证正面
            this.id_card_reverse = res.id_card_reverse;//身份证反面
            this.school_image = res.school_image;//毕业证书
            this.school_image_hand = res.school_image_hand;//毕业证书
            this.school_id = res.school_id;//院校名称
            this.school_name = res.school_name;//院校名称
            this.learn_start = res.learn_start;//学历开始时间
            this.learn_end = res.learn_end;//学历结束时间
            this.education = res.education;//学历
            this.profession = res.profession;//专业
            this.grade = res.grade;//年级
            this.give_lessons = res.give_lessons_text;//主辅教

            //建议价格
            let advice_age_range;
            for(let i=0;i<this.give_lessons.length;i++){
              advice_age_range = this.grade_origal[this.give_lessons[i].grade].age_range_id;
              advice_age_range = this.$xyfun.age_range_by_grade(this.common.customConfig.age_range,advice_age_range);
              this.give_lessons_notice[i] = advice_age_range.advise_settled+'元';
            }
            //自动填充
            if(res.give_lessons_text.length==0){
              this.give_lessons.push({grade : '', grade_cn : '', subject : '', subject_cn : ''})
              this.give_lessons.push({grade : '', grade_cn : '', subject : '', subject_cn : ''})
              this.give_lessons.push({grade : '', grade_cn : '', subject : '', subject_cn : ''})
            }
            if(res.give_lessons_text.length==1){
              this.give_lessons.push({grade : '', grade_cn : '', subject : '', subject_cn : ''})
              this.give_lessons.push({grade : '', grade_cn : '', subject : '', subject_cn : ''})
            }
            if(res.give_lessons_text.length==2){
              this.give_lessons.push({grade : '', grade_cn : '', subject : '', subject_cn : ''})
            }

            //如果之前选择了年级，相关的科目picker要更变数据
            for(let i=0;i<this.give_lessons.length;i++){
              if(this.give_lessons[i].grade){
                this.gl_subject_list_auto(i);
              }
            }
            this.give_timesec = res.give_timesec;//常年授课概况
            this.give_time = res.give_time_text;//周授课空闲时间

            this.holiday_pick = res.holiday_pick;
            this.holiday_pick_arr = this.arrFormat(res.holiday_pick_arr);
            this.holiday_pick_arr_selected = res.holiday_pick_arr_selected;
            this.holiday_area = res.holiday_area_text;//寒暑假授课区域

            this.unholiday_pick = res.unholiday_pick;
            this.unholiday_pick_arr = this.arrFormat(res.unholiday_pick_arr);
            this.unholiday_pick_arr_selected = res.unholiday_pick_arr_selected;
            this.unholiday_area = res.unholiday_area_text;//非寒暑假授课区域

            this.photo_images = res.photo_images_text;//个人照片
            this.avatar = res.avatar;//头像
            this.teacher_age = res.teacher_age!==0?res.teacher_age:'';//教龄
            if(res.tags_text.length>0){
              this.tags = res.tags_text;//个人标签
            }
            this.main_image = res.main_image;//教师资格证
            this.show_main_image = res.show_main_image;
            this.cert_require_test();
            this.cert_name = res.cert_name;//职称证书名称
            this.cert_image = res.cert_image;//职称证书
            if(res.teacher_exp_text.length>0){
              this.teacher_exp = res.teacher_exp_text;//教育经历
            }
            this.case_name = res.case_name;//成功案例标题
            this.case_content = res.case_content;//科研成果
            this.honor_images = res.honor_images_text;//奖励荣誉
            if(res.person_video){
              this.person_video = res.person_video;//展示视频
              this.person_video_local = this.$xyfun.image(res.person_video);//展示视频
            }
            this.before_status = res.status;
          }

          if(this.before_status==1){
            this.agree_countdown = 0;
            uni.showModal({
              title: '提示',
              content: '您之前提交的资料正在审核中...',
              showCancel: false,
              confirmText: '知道了',
              success: function (res) {
              }
            });
          }

          if(this.before_status==2){
            this.agree_countdown = 0;
            uni.showModal({
              title: '提示',
              content: '您的之前提交的资料已经通过审核，仅“授课科目”、“授课时间”、“非寒暑假授课区域”、“寒暑假授课区域”可进行自主再次修改！',
              showCancel: false,
              confirmText: '知道了',
              success: function (res) {
              }
            });
          }

          if(this.before_status==3){
            this.agree_countdown = 0;
            uni.showModal({
              title: '提示',
              content: '您之前提交的资料被驳回了，请重新提交资料',
              showCancel: false,
              confirmText: '知道了',
              success: function (res) {
              }
            });
          }
        }
      })
    },

    arrFormat(data){
      let formatData = [];
      for(let i=0;i<data.length;i++){
        formatData.push({
          text : data[i],
          value : data[i]
        })
      }
      return formatData;
    },

    arrFormatByKey(data){
      let formatData = [];
      for(let i=0;i<data.length;i++){
        formatData.push({
          text : data[i],
          value : i
        })
      }
      return formatData;
    },

    settledTypeChange(e){
     this.cert_require_test();
    },

    settledTypeFreeChange(e){
      this.cert_require_test();
    },

    cert_require_test(){
      let cert_require = false;
      if(this.settled_type_free.includes('专职教学家教')){
        cert_require = true;
        if(!this.main_image) this.$xyfun.msg('请上传教师资格证！')
      }else if(this.settled_type.length>0){
        cert_require = true;
        if(!this.main_image) this.$xyfun.msg('请上传教师资格证！')
      }
      this.cert_require = cert_require;

    },

    sexChange(e){
      this.sex = this.sex_list[e.detail.value];
    },

    learnStartChange(e){
      this.learn_start = e.detail.value;
    },
    learnEndChange(e){
      this.learn_end = e.detail.value;
    },
    educationChange(e){
      this.education = this.education_list[e.detail.value];
    },
    teacherGradeChange(e){
      this.grade = this.teacher_grade_list[e.detail.value];
    },

    gradeGroupChange(e){
      let key = parseInt(e.target.dataset.key);
      this.give_lessons[key].grade = this.grade_list[e.detail.value].id;
      this.give_lessons[key].grade_cn = this.grade_list[e.detail.value].name;
      this.gl_subject_list_auto(key);
      let advice_age_range = this.grade_origal[e.detail.value].age_range_id;
      advice_age_range = this.$xyfun.age_range_by_grade(this.common.customConfig.age_range,advice_age_range);
      this.give_lessons_notice[key] = advice_age_range.advise_settled+'元';
    },
    subjectGroupChange(e){
      let key = parseInt(e.target.dataset.key);
      this.give_lessons[key].subject = this.subject_list[e.detail.value].id;
      this.give_lessons[key].subject_cn = this.subject_list[e.detail.value].name;
    },

    gl_subject_list_auto(key){
      let res = this.$xyfun.subject_by_grade(this.common.customConfig.subject,this.give_lessons[key].grade,this.give_lessons[key].subject);
      if(key==0){
        this.gl_subject_list1 = res.subject_list;
      }
      if(key==1){
        this.gl_subject_list2 = res.subject_list;
      }
      if(key==2){
        this.gl_subject_list3 = res.subject_list;
      }
      if(!res.subject_id_finded){
        this.give_lessons[key].subject = '';
        this.give_lessons[key].subject_cn = '';
      }
    },

    clearGiveTime(e){
      let key = parseInt(e.currentTarget.dataset.key);
      let timesec = e.currentTarget.dataset.timesec;
      this.give_time[key][timesec] = '';
    },
    giveTimeInput(e){
      let key = parseInt(e.target.dataset.key);
      let timesec = e.target.dataset.timesec;
      let time_range;
      let res = e.detail.value;
      if(timesec==='morning'){
        time_range = this.morning[0][res[0]]+':'+this.morning[1][res[1]]+'~'+this.morning[3][res[3]]+':'+this.morning[4][res[4]];
      }
      if(timesec==='afternoon'){
        time_range = this.afternoon[0][res[0]]+':'+this.afternoon[1][res[1]]+'~'+this.afternoon[3][res[3]]+':'+this.afternoon[4][res[4]];
      }
      if(timesec==='night'){
        time_range = this.night[0][res[0]]+':'+this.night[1][res[1]]+'~'+this.night[3][res[3]]+':'+this.night[4][res[4]];
      }
      this.give_time[key][timesec] = time_range;
    },

    chooseHolidayChange(e){
      this.holiday_pick = e.data[0]+' '+e.data[1]+' '+e.data[2];
      this.$api.postBase({
        url: 'teacher/getAreas',
        data: {
          province : e.data[0],
          city : e.data[1]
        },
        success: res => {
          this.holiday_pick_arr = this.arrFormat(res);
          this.holiday_pick_arr_selected = [e.data[2]]
        }
      })
    },
    chooseHolidayLocation(lat,lng,title,address){
      // TODO 这里有些时候会失效 比如北京市北京市东城区
      address = address.replace(this.holiday_pick,'');
      this.holiday_area = [
        address,
        title,
        lat,
        lng
      ];
    },
    mapHoliday(){
      if(!this.holiday_pick){
        this.$xyfun.msg('请选择区域');
      }else{
        this.$xyfun.to('/pages/user/map?type=work&search='+this.holiday_pick)
      }
    },

    chooseUnHolidayChange(e){
      this.unholiday_pick = e.data[0]+' '+e.data[1]+' '+e.data[2];
      this.$api.postBase({
        url: 'teacher/getAreas',
        data: {
          province : e.data[0],
          city : e.data[1]
        },
        success: res => {
          this.unholiday_pick_arr = this.arrFormat(res);
          this.unholiday_pick_arr_selected = [e.data[2]]
        }
      })
    },
    chooseUnHolidayLocation(lat,lng,title,address){
      // TODO 这里有些时候会失效 比如北京市北京市东城区
      address = address.replace(this.unholiday_pick,'');
      this.unholiday_area = [
        address,
        title,
        lat,
        lng
      ];
    },
    mapUnHoliday(){
      if(!this.unholiday_pick){
        this.$xyfun.msg('请选择区域');
      }else{
        this.$xyfun.to('/pages/user/map?type=holiday&search='+this.unholiday_pick)
      }
    },

    chooseIdCardFront(e){this.id_card_front = e;},

    chooseIdCardReverse(e){this.id_card_reverse = e;},

    chooseSchoolImage(e){this.school_image = e;},

    chooseSchoolImageHand(e){this.school_image_hand = e;},

    chooseMainImage(e){this.main_image = e;},

    PhotoImagesChoose(e){this.photo_images = e;},

    HonorImagesChoose(e){this.honor_images = e;},

    AvatarChoose(e){this.avatar = e;},

    tagsInput(e){
      let key = parseInt(e.target.dataset.key);
      this.tags[key] = e.detail.value;
    },
    tagsRemove(e){
      let key = parseInt(e.target.dataset.key);
      this.tags.splice(key,1);
    },
    tagsAdd(e){
      if(this.tags.length<3){
        this.tags.push('');
      }
    },

    chooseCertImage(e){this.cert_image = e;},

    expStartChange(e){
      let key = parseInt(e.target.dataset.key);
      this.teacher_exp[key].start = e.detail.value;
    },
    expEndChange(e){
      let key = parseInt(e.target.dataset.key);
      this.teacher_exp[key].end = e.detail.value;
    },
    expAddRow(e){
      this.teacher_exp.push({
        start : '',
        end : '',
        content : ''
      })
    },
    expDelRow(idx){
      this.teacher_exp.splice(idx,1);
    },

    PersonVideo(e){
      this.person_video_local = e.localPath;
      this.person_video = e.sourcePath;
    },

    //创建订单
    createOrder(pay_type){
      var that = this;
      // 提交订单
      var pay = new Pay(pay_type, this.order, 'settled');
      pay.payMehod().then((res)=>{
        that.disabled = false;
        that.$refs.payPop.disabled = false;
        that.$refs.payPop.buyModelShow = false;
        that.before_status = 1;
        uni.showModal({
          title: '提示',
          content: '您的资料已经提交至后台由工作人员进行审核，审核通过后涉及证书以及身份信息部分的资料将无法进行修改，您现在仍可以重新修改资料并重新上传，已支付的入驻费用将不会二次收取',
          showCancel: false,
          confirmText: '知道了',
          success: function (res) {

          }
        });
      },(res)=>{
        that.$refs.payPop.disabled = false;
        // if(pay_type != 'balance'){
        //   pay.payResult(res);
        // }
      });
    },

    agree_no(){
      this.agreementModelShow = false;
    },
    agree_yes(){
      this.$api.postBase({
        url : 'teacher/agreement',
        data : {},
        success: res => {

        }
      })
      this.agree = true;
      this.agreementModelShow = false;
      this.confirm();
    },
    //同意倒计时
    startCountdown() {
      // 使用 setInterval 开始倒计时
      this.timer = setInterval(() => {
        if (this.agree_countdown > 0) {
          this.agree_countdown--;
        } else {
          clearInterval(this.timer); // 停止倒计时
        }
      }, 1000); // 每隔 1 秒执行一次
    },
    confirm(){
      if(!this.agree){
        this.agreementModelShow = true;
        this.startCountdown();
        return
      }
      this.$api.postBase({
        url : 'teacher/apply',
        data : this.getFullData(),
        success: res => {
          if(res.isUpdate){
            if(res.money){
              this.$refs.payPop.showDiaLog(res.money)
              this.order = res.order;
            }else if(res.is_auto_pass){
              uni.showModal({
                title: '提示',
                content: '资料修改自动生效',
                showCancel: false,
                confirmText: '知道了',
                success: function (res) {

                }
              });
            }else{
              uni.showModal({
                title: '提示',
                content: '资料已经提交至后台由工作人员进行审核',
                showCancel: false,
                confirmText: '知道了',
                success: function (res) {

                }
              });
            }
          }else{
            this.$xyfun.msg('请更新资料后再进行提交')
          }
        },fail: res=>{
          this.$xyfun.msg(res.msg);
        }
      })
    },

    savaDraft(){
      this.$api.postBase({
        url : 'teacher/save_draft',
        data : this.getFullData(),
        success: res => {
          this.$xyfun.msg('保存成功');
        },fail: res=>{

        }
      })
    },



    getFullData(){
      let fromData = {};
      fromData.teaching_method = this.teaching_method.join();//授课方式
      fromData.settled_type_free = this.settled_type_free.join();//免费入驻类型
      fromData.settled_type = this.settled_type.join();//付费入驻类型
      fromData.nickname = this.nickname;//昵称
      fromData.mobile = this.mobile;//联系方式
      fromData.wx_phone = this.wx_phone;//微信手机号
      fromData.realname = this.realname;//真实姓名
      fromData.id_code = this.id_code;//身份证号
      fromData.sex = this.sex;//男
      fromData.id_card_front = this.id_card_front;//身份证正面
      fromData.id_card_reverse = this.id_card_reverse;//身份证反面
      fromData.school_image = this.school_image;//毕业证书
      fromData.school_image_hand = this.school_image_hand;//毕业证书
      fromData.school_id = this.school_id;//院校名称
      fromData.school_name = this.school_name;//院校名称
      fromData.learn_start = this.learn_start;//学历开始时间
      fromData.learn_end = this.learn_end;//学历结束时间
      fromData.education = this.education;//学历
      fromData.profession = this.profession;//专业
      fromData.grade = this.grade;//年级
      fromData.give_lessons = this.give_lessons;//主辅教
      fromData.give_timesec = this.give_timesec;//常年授课概况
      fromData.give_time = this.give_time;//周授课空闲时间
      fromData.holiday_pick = this.holiday_pick;
      fromData.holiday_area = this.holiday_area;//寒暑假授课区域
      fromData.holiday_areas = this.holiday_pick_arr_selected;//寒暑假授课区域
      fromData.unholiday_pick = this.unholiday_pick;
      fromData.unholiday_area = this.unholiday_area;//非寒暑假授课区域
      fromData.unholiday_areas = this.unholiday_pick_arr_selected;//非寒暑假授课区域
      fromData.photo_images = this.photo_images;//个人照片
      fromData.avatar = this.avatar;//头像
      fromData.teacher_age = this.teacher_age;//教龄
      fromData.tags = this.tags;//个人标签
      fromData.main_image = this.main_image;//教师资格证
      fromData.cert_name = this.cert_name;//职称证书名称
      fromData.cert_image = this.cert_image;//职称证书
      fromData.teacher_exp = this.teacher_exp;//教育经历
      fromData.case_name = this.case_name;//成功案例标题
      fromData.case_content = this.case_content;//科研成果
      fromData.honor_images = this.honor_images;//奖励荣誉
      fromData.person_video = this.person_video;//展示视频

      return fromData;
    },

    selectSchool(id,name){
      this.school_name = name;
      this.school_id = id;
    }
  }
}
</script>

<style>
page{
  background-color: #f9f9f9;
}
</style>

<style lang="scss">
.conetent{
  .toy_box{
    margin: 20rpx 20rpx;
    text-align: justify;
    text{
      font-size: 40rpx;
      color: #feb015;
    }
    .detail{
      letter-spacing: 3rpx;
      display: inline;
      font-size: 25rpx;
      font-weight: bold;
      margin-left: 30rpx;
      position: relative;
      top: 10rpx;
    }
  }
  .cont{
    font-size: 23rpx;
    margin-left: 30rpx;
    margin-bottom: 5rpx;
    margin-right: 14rpx;
    text-align: justify;
  }
  text{
    color: red;
    vertical-align: middle;
  }
}

.card{
  border-radius: 8rpx;
  background: #ffffff;
  padding: 20rpx 20rpx;
  margin: 20rpx 20rpx;
  position: relative;
  .title{
    margin-bottom: 20rpx;
    font-size: 30rpx;
    font-weight: bold;
  }
  text{
    color: red;
    vertical-align: middle;
  }
}

.item{
  background:#f7f9fd;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70rpx;
  line-height: 70rpx;
  margin: 20rpx 10rpx;
  padding : 0 20rpx;
  .tit{
    font-size: 26rpx;
    white-space: nowrap;
  }
  .input{
    max-width: calc(100% - 100rpx);
    input{
      font-size: 22rpx;
      height: 60rpx;
      text-align: right;
      color: #707070;
    }
    .simulate{
      width: 100%;
      font-size: 22rpx;
      height: 60rpx;
      text-align: right;
      color: #707070;
    }
    picker{
      font-size: 22rpx;
      color: #707070;
    }
  }
  .picker_group{
    width: 100rpx;
    flex-grow: 1;
    margin-left: 100rpx;
    display: flex;
    justify-content: space-between;
    flex-wrap: nowrap;
    .pg_item{
      width: 30%;
      white-space: nowrap;
      text-align: right;
      height: 60rpx;
      picker{
        height: 60rpx;
        line-height: 60rpx;
      }
      .input{
        box-sizing: border-box;
        height: 60rpx;
        line-height: 60rpx;
      }
      span{
        color: #555;
        display: inline-block;
        font-size: 22rpx;
        position: relative;
        top: -8rpx;
      }
      .yz-jiantou2{
        margin-left: 10rpx;
        color: #707070;
      }
    }
  }
}

.give_timesec{
  margin-bottom: 20rpx;
}
.addr_item{
  height: unset;
  .input{
    height: unset;
    view{
      text-align: justify;
      font-size: 24rpx;
      line-height: 40rpx;
    }
  }
}

.id_card_notice{
  margin-top: 50rpx;
  .tit{
    font-size: 32rpx;
    font-weight: bold;
    margin-bottom: 20rpx;
  }
  .desc{
    font-size: 24rpx;
  }
}
.notice{
  display: flex;
  align-items: center;
  margin-top: 20rpx;
}

.gray_round{
  background:#f8f8f8;
  border-radius: 8rpx;
  margin-bottom: 10rpx;
  padding-bottom: 20rpx;
  text{
    color: #000;
    font-size: 20rpx;
    margin-left: 5rpx;
  }
  .enter{
    color: #1c98c4;
    padding-top: 20rpx;
    padding-left: 20rpx;
    margin-bottom: 10rpx;
  }
  .tags{
    display: flex;
    flex-wrap: wrap;
  }
}

.certs{
  margin-top: 20rpx;
  margin-bottom: 30rpx;
  display: flex;
  justify-content: space-between;
  .cert{
    position: relative;
    width: 200rpx;
    height: 166rpx;
    image{
      border-radius: 25rpx;
      width: 200rpx;
      height: 166rpx;
    }
    .hover{
      width: 200rpx;
      height: 166rpx;
      & /deep/ .choose_image{
        width: 200rpx;
        height: 166rpx;
      }
    }
  }
  .cert_upload{
    width: 200rpx;
    height: 166rpx;
    background: #f9f9f9;
    color: #b2b2b2;
    border: 1rpx dashed #b2b2b2;
    border-radius: 15rpx;
    text-align: center;
    line-height: 166rpx;
    font-size: 40rpx;
    box-sizing: border-box;
  }
}

.big_upload_picker{
  border: 1rpx dashed #555;
  text-align: center;
  line-height: 320rpx;
  margin: 40rpx auto 0 auto;
  border-radius: 20rpx;
  font-size: 50rpx;
  position: relative;
  width: 500rpx;
  overflow: hidden;
  box-sizing: border-box;
  *{
    width: 500rpx;
    height: 320rpx;
    display: block;
  }
  .hover{
    width: 500rpx;
    height: 320rpx;
    display: block;
    & /deep/ .choose_image{
      width: 500rpx;
      height: 320rpx;
    }
  }
}

.avatar{
  width: 100rpx;
  height: 100rpx;
  position: relative;
  border-radius: 20rpx;
  background-size: cover;
  overflow: hidden;
  image{
    width: 100rpx;
    height: 100rpx;
  }
  .hover{
    width: 100rpx;
    height: 100rpx;
    & /deep/ .choose_image{
      width: 100rpx;
      height: 100rpx;
    }
  }
}

.tag{
  display: flex;
  flex-grow: 1;
  margin-left: 40rpx;
  align-items: center;
  .input{
    flex-grow: 1;
    font-size: 26rpx;
    input{
      text-align: left;
    }
  }
  .action{
    display: flex;
    align-items: center;
    font-size: 28rpx;
    view{
      display: block;
      color: #333333;
      background: #ffa900;
      font-weight: bold;
      width: 30rpx;
      height: 30rpx;
      line-height: 32rpx;
      text-align: center;
      border-radius: 15rpx;
      margin-right: 2rpx;
    }
  }
}

.small_upload_picker{
  margin: 40rpx auto 0 auto;
  border-radius: 20rpx;
  font-size: 50rpx;
  position: relative;
  width: 500rpx;
  height: 260rpx;
  overflow: hidden;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  .notice{
    font-size: 26rpx;
    color: #868686;
    margin-bottom: 30rpx;
  }
  .small_upload{
    width: 140rpx;
    height: 140rpx;
    text-align: center;
    line-height: 140rpx;
    font-size: 50rpx;
    border: 1rpx dashed #555;
    border-radius: 14rpx;
    box-sizing: border-box;
  }
  image{
    width: 500rpx;
    height: 260rpx;
    display: block;
  }

  .hover{
    width: 500rpx;
    height: 260rpx;
    & /deep/ .choose_image{
      width: 500rpx;
      height: 260rpx;
    }
  }
}

.card{
  .exp_item{
    position: relative;
    padding-top: 14rpx;
    .yz-guanbi{
      position: absolute;
      right: 0;
      top: 0;
      color: $uni-color-error;
    }
    &:not(:nth-of-type(1)){
      margin-top: 50rpx;
    }
  }
}

.case_edit{
  font-size: 28rpx;
  letter-spacing: 2rpx;
  height: 180rpx;
  text-align: center;
  width: 100%;
  padding: 50rpx 20rpx 0 20rpx;
  box-sizing: border-box;
}

.add_exp{
  position: absolute;
  bottom: -15rpx;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: 200rpx;
  height: 40rpx;
  line-height: 40rpx;
  font-size: 24rpx;
  border-radius: 20rpx;
  background: #ffa900;
  color: #fff;
  text-align: center;
}


.id_card{
  margin-top: 20rpx;
  position: relative;
  .bg{
    width: 636rpx;
    height: 383rpx;
  }
  .hover{
    width: 636rpx;
    height: 383rpx;
    & /deep/ .choose_image{
      width: 636rpx;
      height: 383rpx;
    }
  }
}

checkbox {
  transform: scale(0.8);
  font-size: 30rpx;
  white-space: normal;
}

.confirm_box{
  background: #fff;
  position: fixed;
  bottom: 0;
  z-index: 999;
  padding: 10rpx 30rpx 20rpx 30rpx;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  .confirm{
    color: #fff;
    height: 80rpx;
    line-height: 80rpx;
    background: #1c98c4;
    border-radius: 10rpx;
    font-size: 30rpx;
    text-align: center;
    flex-grow: 1;
  }
  .draft{
    color: #777;
    text-align: center;
    margin-left: 40rpx;
    view{
      font-size: 40rpx;
      margin-bottom: -10rpx;
    }
    text{
      font-size: 22rpx;
    }
  }
}
.agreement-box{
  width: 95%;
  height: 80vh;
  border-radius: 15rpx;
  .agree-title{
    height: 80rpx;
    line-height: 80rpx;
    font-size: 36rpx;
    text-align: center;
    margin-bottom: 20rpx;
  }
  .agree-content{
    padding: 0 20rpx;
    height: calc(80vh - 200rpx);
    overflow: scroll;

  }
  .agree-action{
    padding: 0 20rpx;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    height: 100rpx;
    align-items: center;
    view{
      width: 200rpx;
      height: 60rpx;
      border-radius: 10rpx;
      line-height: 60rpx;
      text-align: center;
    }
    .countdown{
      width: 100%;
      background: #f2f2f2;
      color: #333333;
    }
    .yes{
      background: $uni-color-primary;
      color: #fff;
    }
    .no{
      background: $uni-color-error;
      color: #fff;
    }
  }
}

.notice{
  .yz-iconfont{
    display: inline-block;
    padding-right: 20rpx;
  }
  text{
    font-size: 26rpx;
    color: $uni-color-error;
  }
}
</style>
